<?php

namespace app\api\controller;


use app\common\controller\Api;
use app\admin\model\Plan;

class Wxplan extends Api{

    protected $userId;

    //手机端计划列表
    public function plan(){
        $userId = $this->userId;
        $params = $this->request->param();
        $page = $params['page'];
        $pageCount = $params['pageCount'];
        $status = $params['status'];
        $plan = new Plan();
        $info = $plan->getInfo(null,null,null,null,$userId,$status,"weigh desc,id desc",$page ,$pageCount );

        //总数
        $total = Plan::where(['admin_id'=>$userId,'status'=>$status])->count();
        $result['total'] = $total;
        $result['info'] = $info;
        $result['pageTotal'] = count($info);
        $this->success('请求成功!!!',$result);
    }

}
